package so.sao.code.service.infrastructure.enums.convert;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

import so.sao.code.service.infrastructure.enums.ActivationMethod;

@Converter(autoApply = true)
public class ActivationMethodConvert implements AttributeConverter<ActivationMethod, Integer> {

	@Override
	public Integer convertToDatabaseColumn(ActivationMethod attribute) {
		return attribute.getValue();
	}

	@Override
	public ActivationMethod convertToEntityAttribute(Integer dbData) {
		return ActivationMethod.fromValue(dbData);
	}

}
